import { atom } from 'recoil';
import type { RecoilState } from 'recoil';

export declare type DictionariesItemType = {
  label: string;
  value: string;
};
export declare type DictionariesModelType = Record<string | number, DictionariesItemType[]>;

export declare type SubscriptionsType = Record<string, any> | undefined;

export const useDictionariesModel = atom({
  key: 'dictionaries',
  default: undefined,
}) as RecoilState<DictionariesModelType | undefined>;

export const useAppDataDoneModel = atom({
  key: 'appDataDone',
  default: false,
}) as RecoilState<boolean | undefined>;

export const useSubscriptionsModel = atom({
  key: 'subscriptions',
  default: undefined,
}) as RecoilState<SubscriptionsType>;
